<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp" %>
<style>
.easyui-text{
	width: 140px; height: 25px;border-radius:5px;border:thin solid #ddd;
	border-color:#a4e9c1;
}
.easyui-text:focus{
	outline: none;
}
</style>
<script type="text/javascript">
    $(function() {
        $('#fruitEditForm').form({
            url : '${path}/fruit/edit',
            onSubmit : function() {
                progressLoad();
                var isValid = $(this).form('validate');
                if (!isValid) {
                    progressClose();
                }
                return isValid;
            },
            success : function(result) {
                progressClose();
                result = $.parseJSON(result);
                if (result.success) {
                    showMsg(result.msg);
                    parent.$.modalDialog.openner_dataGrid.datagrid('reload');//之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为user.jsp页面预定义好了
                    parent.$.modalDialog.handler.dialog('close');
                } else {
                    var form = $('#fruitEditForm');
                    parent.$.messager.alert('错误', result.msg, 'error');
                }
            }
        });
    });
</script>
<div class="easyui-layout" data-options="fit:true,border:false">
    <div data-options="region:'center',border:false" title="" style="overflow-x:hidden;overflow-y: auto;padding: 3px;">
        <form id="fruitEditForm" method="post">
             <table class="grid">
<input type="hidden" name="id" value="${fruit.id}">
 <tr>
<td>名称</td>
                     <td>
                                            <input name='name' id='name'  type='text' placeholder='请输入名称' class='easyui-text  span2' value='${fruit.name}'>
                                     </td>
                     <td>价格</td>
                     <td>
                        <input name='price' id='price'  type='text' placeholder='请输入价格' class='easyui-text  span2' value='${fruit.price}'>
                  </td>
                  </tr>
            </table>
        </form>
    </div>
</div>